//
//  ZNGViewController.m
//  ZNGLibrary
//
//  Created by Frozenkingdom on 10/26/2015.
//  Copyright (c) 2015 Frozenkingdom. All rights reserved.
//

#import "ZNGViewController.h"

#import "ZNGCityPickerView.h"
#import "ZNGAlertView.h"

@interface ZNGViewController ()
@property (weak, nonatomic) IBOutlet UITextField *textField;

@end

@implementation ZNGViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    

    
    self.textField.inputView = [ZNGCityPickerView cityPickerWithSelecteAction:^(ZNGLocateModel *selecteLcoate) {
        self.textField.text = selecteLcoate.province.name;
        [self.textField endEditing:YES];
    } cancelAction:^{
        [self.textField endEditing:YES];
        ZNGAlertView *alertView = [[ZNGAlertView alloc] initWithTitle:@"提示" message:@"当前版本过低，请更新..." cancelButtonTitle:@"确定" otherButtonTitles: nil];
        [alertView showWithButtonClickAction:^(NSInteger index) {
            exit(0);
        }];
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
